package cn.hznc.repository;

import cn.hznc.domain.entity.ToolLifeAnalyzeEntity;
import cn.hznc.domain.entity.ToolPartEntity;
import cn.hznc.domain.request.inventory.*;
import cn.hznc.domain.request.life.QryToolLifeReq;
import cn.hznc.domain.request.life.QueryToolLifeReq;
import cn.hznc.domain.request.retrospect.ToolRestrospectReq;
import cn.hznc.domain.request.schedule.ToolReturnIndexReq;
import cn.hznc.domain.request.schedule.ToolReturnReq;
import cn.hznc.domain.request.toolAnalyze.ToolTypeUsageAnalysisReportReq;
import cn.hznc.domain.request.toolpart.EditToolPartLengthAndRadiusReq;
import cn.hznc.vo.*;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @Author：Administrator
 * @Date：2023/4/6 10:56
 */
public interface ToolPartRespository{
    //List<ToolPartVo> getLocationToolDetail(LocationToolDetailReq locationToolDetailReq);

    ToolPartVo getLocationToolDetail(LocationToolDetailReq locationToolDetailReq);

    List<ToolRestrospectVo> queryToolRetrospectAllList(ToolRestrospectReq toolRestrospectReq);

    void saveBatch(List<ToolPartEntity> toolPartEntityList);

    List<ToolPartEntity> selectByTypeAndLocation(@Param("type") String toolType,@Param("locationId") Integer toolLocationId);

    List<ToolLifeIndexVo> queryToolLifeIndex(QueryToolLifeReq queryToolLifeReq);

    String getByLocation(@Param("warehouseName") String key,@Param("locationNum") String o);

    List<ToolPartEntity> selectList(ToolReturnReq toolReturnReq);

    Date getInboundTime(@Param("id") Integer id);

    List<ToolPartEntity> selectAllList(ToolReturnIndexReq toolReturnIndexReq);

    ToolPartEntity getByUniqueId(@Param("uniqueId") String uniqueId);

    String getNameByToolNo(@Param("toolNo") String toolNo);

    AssembleMaterialPartVo selectByUniqueId(String toolUniqueId);

    List<ToolPartEntity> selectByAssemblyRFId(String uniqueId);

    List<ToolPartEntity> selectToolRetrospectIndex(@Param("uniqueId") String uniqueId , @Param("partno") String partno , @Param("toolNo") String toolNo , @Param("list") List<Integer> list , @Param("sortFlag")boolean sortFlag , @Param("typeFlag") Integer typeFlag);

    Integer getIdByUniqueId(@Param("uniqueId") String s);

    List<InOrOutboundRecordVo> selectRecord(List<Integer> ids);

    List<ToolPartEntity> selectListByLocationIdAndToolNo(@Param("toolNo") String toolNo,@Param("locationId") Integer locationId);

    List<ToolPartEntity> selectByIds(@Param("ids") List<Integer> ids);

    String getByToolParam(@Param("toolNo") String toolNo,@Param("length") String length,@Param("radius") String radius);

    Integer countByType(String type);


    List<ToolPartVo> getLocationToolsDetail(LocationToolDetailReq locationToolDetailReq);

    Integer selectCountByPartno(@Param("partno") String partno);

    Integer selectCountByToolType(@Param("partnos") List<String> partnos, @Param("warehouseType") String warehouseType);

    Integer selectCountByToolTypeGroup(@Param("toolType") String toolType,@Param("warehouseType") String warehouseType);

    List<ToolPartNoManagementVo> queryNoManagementToolPart(ToolPartsManageReq toolPartsManageReq);

    List<ToolPartNoManagementVo> queryNoManagementAssembleToolPart(ToolPartsManageReq toolPartsManageReq);

    List<ToolPartEntity> queryNoManagementToolParts(NoManagementReq noManagementReq);

    Integer countByPartType(@Param("partType") String partType);

    Integer countByToolNo(@Param("toolNo") String toolNo);

    ToolPartEntity getByLocationId(@Param("inventoryLocationId") Integer inventoryLocationId);

    void updateByRfid(@Param("uniqueId") String uniqueId);

    Integer selectByRecord(@Param("toolType") String toolType , @Param("date") Date date);

    List<ToolPartEntity> selectByRecordId(@Param("recordId") Integer recordId);

    void updateSelectedFlagById(@Param("randomToolPartId") String randomToolPartId,@Param("flag") int flag, @Param("id")Integer id ,@Param("groupId") String groupId);

    void updateSelectedFlagByIds(@Param("id") String randomToolPartId,@Param("flag") int flag);

    List<ToolPartEntity> selectUnSelectedList(UnselectedReq unselectedReq);

    List<ToolPartEntity> qryAllToolPart(@Param("qryAllToolPartReq") QryAllToolPartReq qryAllToolPartReq);

    List<ToolPartEntity> qryAllToolParts(@Param("qryAllToolPartReq") QueryAllToolPartReq queryAllToolPartReq);

    Integer selectByRecordReload(@Param("toolType") String toolType,@Param("date") Date date);

    List<ToolStockVo> queryToolStock(ToolTypeUsageAnalysisReportReq toolTypeUsageAnalysisReportReq);

    List<UnselectedAssemblyToolVo> qryNnSelectedAssemblyTool(@Param("toolNo") String toolNo);

    void editToolPartLengthAndRadius(EditToolPartLengthAndRadiusReq editToolPartLengthAndRadiusReq);

    List<ToolLifeAnalyzeVo> queryToolLifeAnalyze(QryToolLifeReq qryToolLifeReq);

    void deleteByLocation(@Param("warehouseTypes") List<String> warehouseTypes);

    List<Integer> selectByRecordReload1(@Param("toolType") String toolType,@Param("date") String date , @Param("warehouseType")String warehouseType);
    List<ToolPartEntity> selectByRecordReload2(@Param("partno") String partno,@Param("date") String date , @Param("warehouseTypes")List<String> warehouseTypes);

    List<ToolPartEntity> selectByRecordIdReload(List<Integer> recordIds);

    String getByToolParamReload(@Param("toolNo") String toolNo,@Param("length") String length);

    Integer selectCountByLocationId(@Param("inventoryLocationId") Integer inventoryLocationId);

    List<ToolPartEntity> toolReturnIndexReload(ToolReturnIndexReq toolReturnIndexReq);

    Integer selectCountByCondition(@Param("partno")String partno,@Param("toolNo") String toolNo,@Param("inventoryLocationId") Integer inventoryLocationId);

    Integer selectCountByLocationIds(@Param("locationIds") List<Integer> locationIds);

    List<ToolDamageReportVo> selectToolDamageReport(ToolDamageReportReq toolDamageReportReq);

    List<ToolPartEntity> selectlistByLocationIdAndToolId(@Param("inventoryLocationId") Integer inventoryLocationId,@Param("toolId") Integer toolId);

    List<ToolForkInfoCountVo> selectCountByPartnos(@Param("partnos") List<String> partnos);

    String getPartnoByUniqueId(@Param("uniqueId") String uniqueId);

    List<String> selectExistToolNos();

}
